package com.wz.two;

/**
 * @description:
 * @author: WZ
 * @create: 2019-02-16 14:46
 **/

public class GWeather extends Observeable<GWeather,Race,WeatherType>{

    private WeatherType currentWeatherType;

    public GWeather(){
        this.currentWeatherType = WeatherType.COLD;
    }

    public void timePass(){
        WeatherType[] enumValue = WeatherType.values();
        currentWeatherType = enumValue[(currentWeatherType.ordinal() + 1) % enumValue.length];
        System.out.println("The Weather change to {}."+ currentWeatherType.name());
        notifyObservers(currentWeatherType);
    }
}
